package com.xckj.teacher.ui.adapter

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xckj.teacher.R

class AccountAdapter(data: MutableList<String>, var select: Int) :
    BaseQuickAdapter<String, BaseViewHolder>(
        R.layout.item_account_list_dialog, data
    ) {
    override fun convert(holder: BaseViewHolder, item: String) {
        holder.setText(R.id.tv_account, item)
        if (holder.layoutPosition == select) {
            holder.setBackgroundResource(R.id.tv_account, R.drawable.rec_2979ff)
            holder.setTextColor(R.id.tv_account, Color.parseColor("#ffffff"))
        } else {
            holder.setBackgroundResource(R.id.tv_account, 0)
            holder.setTextColor(R.id.tv_account, Color.parseColor("#FF666666"))
        }
    }

    init {
        addChildClickViewIds(R.id.iv_delete)
    }
}